package com.zelin.controller;

import com.zelin.pojo.Student;
import com.zelin.service.StudentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/student")
public class StudentController {
    @Autowired
    private StudentService studentService;
//查询学生信息
@RequestMapping("/list")
    public List<Student> findAll(){
        System.out.println("开始运行StudentController  findAll");
        return studentService.findAll();
    }

@RequestMapping("/search")
    public List<Student> searchStudent(){
    System.out.println("开始运行StudentController search");
    return studentService.searchStudent();
}
}
